//
//  Home3TableViewCell.m
//  MobileOffice
//
//  Created by jjkj on 16/11/30.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "Home3TableViewCell.h"

@implementation Home3TableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor=[UIColor clearColor];
        self.backgroundColor=[UIColor clearColor];
        _timeLabel=[MyControl creatLabelWithFrame:CGRectMake(15, 8, 40, 20) text:@"08:20"];
        _timeLabel.font=FONT_13;
        _timeLabel.textAlignment=NSTextAlignmentCenter;
        [self.contentView addSubview:_timeLabel];
        
        _lineImageView=[MyControl creatImageViewWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width+8, 0, 0.5, 66) imageName:@""];
        _lineImageView.backgroundColor=[UIColor lightGrayColor];
        [self.contentView addSubview:_lineImageView];
        
        _stateImageView=[MyControl creatImageViewWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width, 10, 16, 16) imageName:@"checkbox_normal@2x"];
        [self.contentView addSubview:_stateImageView];
        
        _backButton=[MyControl creatButtonWithFrame:CGRectMake(_lineImageView.x+_lineImageView.width+15, 8, IPHONE_WIDTH-(_lineImageView.x+_lineImageView.width+15)-8, 50) target:self sel:@selector(buttonClick) tag:100 image:nil title:@""];
        _backButton.backgroundColor=[UIColor lightGrayColor];
        _backButton.layer.cornerRadius=5;
        [self.contentView addSubview:_backButton];
        
        _titleLabel=[MyControl creatLabelWithFrame:CGRectMake(5, 5, _backButton.width-45, 15) text:@""];
        _titleLabel.font=FONT_14;
        [_backButton addSubview:_titleLabel];
        
        _stateLabel=[MyControl creatLabelWithFrame:CGRectMake(5, _titleLabel.y+_titleLabel.height+5, _titleLabel.width, 20) text:@""];
        _stateLabel.font=FONT_12;
        _stateLabel.textColor=[UIColor grayColor];
        [_backButton addSubview:_stateLabel];
        
        _photoImageView=[MyControl creatImageViewWithFrame:CGRectMake(_backButton.width-16, (_backButton.height-14)/2, 8, 14) imageName:@"k_ic_jt@2x"];
        [_backButton addSubview:_photoImageView];
        
    }
    return self;
}

- (void)buttonClick{
    
}

- (void)setCellInfoWithModel:(SignInInfoModel *)model{

    _timeLabel.text=[LZXHelper getTimeStrWithOldDateFomatter:@"yyyy-MM-dd HH:mm:ss" DateStr:model.eventTime newFormatter:@"HH:mm"];
    self.titleLabel.text=model.eventCode;
    self.stateLabel.text=model.result;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
